<template>
  <div class="shops">
    <!-- 导航区 -->
    <ul>
      <li v-for="shops in shopsList" :key="shops.id">
        <!-- <RouterLink 
        :to="`/shops/ShopsDetail/${shops.id}/${shops.title}/${shops.content}`">{{
          shops.title
        }}</RouterLink> -->
        <RouterLink
          :to="{
            name: 'ShopsDetail',
            params: {
              id: shops.id,
              title: shops.title,
              content: shops.content,
            },
          }">
          {{ shops.title }}
        </RouterLink>
      </li>
    </ul>
    <!-- 展示区 -->
    <div class="shops-content">
      <RouterView></RouterView>
    </div>
  </div>
</template>

<script setup lang="ts" name="Shops">
  import { reactive } from 'vue'
  import { RouterView, RouterLink } from 'vue-router'

  const shopsList = reactive([
    { id: 'wqertyu01', title: '数码', content: 'iPhone' },
    { id: 'wqertyu02', title: '穿搭', content: '格子衫' },
    { id: 'wqertyu03', title: '零食', content: '红豆泥' },
    { id: 'wqertyu04', title: '雨具', content: '太阳伞' },
  ])
</script>

<style scoped>
  /* 商店 */
  .shops {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    height: 100%;
  }
  .shops ul {
    margin-top: 30px;
    list-style: none;
    padding-left: 10px;
  }
  .shops li > a {
    font-size: 18px;
    line-height: 40px;
    text-decoration: none;
    color: #64967e;
    text-shadow: 0 0 1px rgb(0, 84, 0);
  }
  .shops-content {
    width: 70%;
    height: 90%;
    border: 1px solid;
    margin-top: 20px;
    border-radius: 10px;
  }
</style>
